The present invention relates to a process for the preparation of cyclic lactams of formula (II): 
in which n and m can each have the values 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 and the sum of n+m is at least 3, preferably at least 4, and R1 and R2 are C1-C6-alkyl, C5-C7-cycloalkyl or C6-C12-aryl groups,
by reacting a compound (I) of the formula 
in which R1, R2, m and n are as defined above and R are [sic] nitrile, carboxamide and carboxylic acid groups,
with steam in the gas phase, wherein
a) the compound (I) is reacted with steam in the gas phase with the addition, before or after the reaction, of an organic diluent (III) which exhibits a miscibility gap with water under specific quantity, pressure and temperature conditions,
to give a mixture (IV) containing a lactam (II),
b) the mixture (IV) is converted, before or after the separation of ammonia, under quantity, pressure and temperature conditions such that the diluent (III) and water are liquid and exhibit a miscibility gap, to give a two-phase system consisting of a phase (V) containing a higher proportion of diluent (III) than water, and a phase (VI) containing a higher proportion of water than diluent (III),
c) the phase (V) is separated from the phase (VI), and
d) the diluent (III) and optionally by-products selected from the group consisting of low-boiling component [sic], high-boiling component [sic] and unreacted compound (I) are separated from the phase (V) to give a lactam (II).
Processes for the preparation of cyclic lactams by reacting omega-aminocarboxylic acid derivatives with steam in the gas phase in the presence of heterogeneous catalysts, for example the preparation of caprolactam from 6-aminocarboxylic [sic] acid nitrile, are generally known.
Thus WO 96/22974, EP-A-659741, WO 99/47500 and WO 99/28296 disclose the reaction of 6-aminocapronitrile with steam in the gas phase in the presence of heterogeneous catalysts to give caprolactam and ammonia, examples of the heterogeneous catalysts used being aluminum oxide, lanthanum phosphates and zirconium dioxide. WO 96/22974 points out that it is not excluded to carry out the cyclization using a diluent which is inert under the reaction conditions, for example an alkane, a cycloalkane, an aromatic hydrocarbon or a halogenohydrocarbon, and thus to have a liquid phase in the reaction mixture.
WO 98/05636 describes the work-up of reaction discharges such as those obtained in the gas phase cyclization of 6-aminocapronitrile with steam in the presence of solid catalysts. To effect said work-up:
a) the bulk of the ammonia formed in the cyclization is separated from the water-containing crude caprolactam, and
b) this crude caprolactam is either subjected to a liquid/liquid extraction with the addition of a solvent containing acidic groups, and/or treated with a cation exchanger.
Measure b) extracts all the amines or binds them to the cation exchanger. The principal disadvantage of this work-up is that aminocapronitrile which has not reacted in the cyclization is taken up by the ion exchangers and, when the ion exchanger is regenerated, is obtained as the ammonium salt mixed with ammonium salts of amine by-products, so it cannot be returned to the cyclization. Ammonium salts are also formed in the extraction of the aminocapronitrile with extractants containing acidic groups, and create the same problems.
It is therefore an object of the present invention to provide a process which makes it possible to prepare cyclic lactams (II) from compounds (I) in a technically simple and economic manner, produces high yields of lactam with high conversions of the compound (I) and also minimizes losses of yield in the work-up.
We have found that this object is achieved by the process defined at the outset.
Suitable compounds (I) are aminocarboxylic acids and derivatives thereof, preferably those of general formula I: 
in which R is carboxylic acid, nitrile and/or carboxamide groups and n and m can each have the values 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 and the sum of n+m is at least 3, preferably at least 4.
In principle, R1 and R2 can be any kind of substituents, the only proviso being that the desired cyclization reaction is not affected by the substituents. Preferably, R1 and R2 independently of one another are C1-C6-alkyl or C5-C7-cycloalkyl groups or C6-C12-aryl groups.
Particularly preferred starting compounds are aminocarboxylic acid nitrites, preferably those of the general formula
H2Nxe2x80x94(CH2)mxe2x80x94Cxe2x89xa1N
in which m has a value of 3, 4, 5 or 6, especially 5. When m=5, the starting compound is 6-aminocapronitrile.
The compound (I) used can be a single compound (I) or a mixture of different compounds (I). The compound (I) used is preferably a single compound.